<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');

$shopList = Shop::GetAllShops();

$defaultShopId = 1;
if($_GET['shop_id'] != null){
	$defaultShopId = abs( intval( $_GET['shop_id'] ) );
}

$action = $_GET['action'];
if( $action == 'del' && $_GET['id'] > 0 ){
	if( $oauthMap[46] == null){
		exit;
	}
	Devices::DeleteById($_GET['id'], $login_user_id);
}

if( $defaultShopId == 0 ){
	$deviceList = Devices::GetAll();
}else{
	$deviceList = Devices::GetAllByShopId($defaultShopId);
}
include template('/service/device_list');


//include template('service_staff_index');
//include template('subscribe');
